def user = session.appUser();
def date = request.getString('DATE');
def week = request.getString('week');

if (date != null) {
	def diary = db.query("select * from DIARY where OPEN_ID=? and DATE=?", user.openId,date);
	return diary;
} else if (week != null) {
	def diary = db.query("select WORK,HEALTH,FAMILY,STUDY,HOBBY,MONEY,RELATIONSHIP,PLAN,ANNIVERSARY,DATE from DIARY where OPEN_ID=? and DATEDIFF('DAY',DATE,?)<=7 order by DATE", user.openId,week);
	return diary;
}
